TARGET=./lib/libreactor.a
SRC=./src/
OBJ=./obj/
CXX=g++
CFLAGS=-g -O2 -Wall -fPIC -Wno-deprecated
INCLUDE=./include/
INC=-I$(INCLUDE)
INCFILES=$(shell find $(INCLUDE) -name *\.h)
CPPFILES=$(shell find $(SRC) -name *\.cpp)
OBJS=$(patsubst %.cpp, %.o, $(subst $(SRC), $(OBJ), $(CPPFILES)))
$(TARGET):$(OBJS) $(INCFILES)
	@mkdir -p lib
	ar cqs $@ $(OBJS)
$(OBJ)%.o:$(SRC)%.cpp
	@mkdir -p $(shell dirname $@)
	$(CXX) $(CFLAGS) $(INC) -c $< -o $@

.PHONY: clean
clean:
	-rm -rf $(OBJ) ./lib/
